/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.classdiagram.editpart;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.uml2.uml.Generalization;

import com.cea.papyrus.core.editor.ModelManager;
import com.cea.papyrus.core.editpart.connection.StereotypedGraphEdgeEditPart;
import com.cea.papyrus.core.figures.connection.SolidLineFigure;
import com.cea.papyrus.diagraminterchange2.di2.GraphEdge;
import com.cea.papyrus.diagraminterchange2.di2.Uml1SemanticModelBridge;

/**
 * Controler for the {@link Generalization} Link.
 */
public class GeneralizationEditPart extends StereotypedGraphEdgeEditPart {

	/**
	 * Creates a new GeneralizationEditPart.
	 * 
	 * @param graphEdge 
	 * @param modelManager 
	 */
	public GeneralizationEditPart(GraphEdge graphEdge,ModelManager modelManager) {
		super(graphEdge,modelManager);
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
	 */
	/**
	 * 
	 * 
	 * @return 
	 */
	@Override
	protected IFigure createFigure() {
		return new SolidLineFigure(ColorConstants.white, ColorConstants.black, 2);

	}

	/* (non-Javadoc)
	 * @see com.cea.papyrus.common.editpart.GraphEdgeEditPart#getUmlElement()
	 */
	/**
	 * 
	 * 
	 * @return 
	 */
	@Override
	public Generalization getUmlElement() {
		return (Generalization)((Uml1SemanticModelBridge)(getGraphEdge()).getSemanticModel()).getElement();
	}
}